home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / make / icmake-6.000 / icmake-6 / icmake / rss / younger.c < prev   
Encoding:
C/C++ Source or Header  |  1994-02-08  |  902 b   |  47 lines

  1. /*                          Y O U N G E R  . C
  2.  
  3.     % 1 name
  4. \funcref {younger}
  5.     % 2 declaration
  6. {int \fname (\params\ )}
  7.     % 3 arguments
  8. {
  9.     {char *}{lval}{name of a file}
  10.     {char *}{rval}{name of a file}
  11. }
  12.     % 4 return value
  13.  
  14. {
  15.  1: the file \Var{lval} is younger than \Var{rval} or \Var{lval} does't exist.
  16.     \Var{rval} exists.
  17.  0: the reversed condition: the file \Var{lval} is older or as old as
  18.     \Var{rval} (\Var{lval} exists), or \Var{rval} doesn't exist
  19. }
  20.     % 5 functions used
  21. {}
  22.     % 6 see also
  23. {}
  24.     % 7 source file
  25. {younger.c}
  26.     % 8 description
  27. {See the return value description}
  28. */
  29.  
  30. #include "icrssdef.h"
  31.  
  32. int younger(lval, rval)
  33.     char
  34.         *lval,
  35.         *rval;
  36. {
  37.     struct stat
  38.         lbuf,
  39.         rbuf;
  40.  
  41.     if (stat(lval, &lbuf))
  42.         lbuf.st_mtime = 0;
  43.     if (stat(rval, &rbuf))
  44.         rbuf.st_mtime = 0;
  45.  
  46.    return (lbuf.st_mtime > rbuf.st_mtime);
  47. }